package com.coffee.core.enums;

public enum DailiMerchantRoleEnum {
    PARTNER("partner", "合伙人"),
    DISTRIBUTOR("distributor", "分销员"),
    MERCHANT("merchant", "商户")
    ;

    private String code;
    private String name;

    private DailiMerchantRoleEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static DailiMerchantRoleEnum getByCode(String code) {
        for (DailiMerchantRoleEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
